<?php

namespace common\models\trade;

use Yii;
use yii\helpers\VarDumper;

/**
 * This is the model class for table "{{%trade_logs}}".
 *
 * @property string $id
 * @property string $user_id 操作用户UID
 * @property string $trade_id 交易订单ID
 * @property string $trade_no 交易号
 * @property string $type
 * @property string $level
 * @property string $data 日志信息
 * @property string $created_at
 * @property string $updated_at
 * @property string $deleted_at
 */
class TradeLogs extends \common\db\ActiveRecord {

    use \common\traits\TimestampBehavior;

    /**
     * @inheritdoc
     */
    public static function tableName() {
        return '{{%trade_logs}}';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['user_id', 'trade_id', 'created_at', 'updated_at', 'deleted_at'], 'integer'],
            [['trade_no', 'type', 'level', 'data'], 'required'],
            [['data'], 'string'],
            [['trade_no', 'type', 'level'], 'string', 'max' => 32],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'user_id' => '操作用户UID',
            'trade_id' => '交易订单ID',
            'trade_no' => '交易号',
            'type' => 'Type',
            'level' => 'Level',
            'data' => '日志信息',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'deleted_at' => 'Deleted At',
        ];
    }

    public static function trace($type, $data) {
        
    }

    public static function info() {
        
    }

    public static function error() {
        
    }

    public static function warning() {
        
    }

}
